import sys


# 2.18 类
class FooClass(object):
    'my first class: FooClass'
    version = 0.1  # class (data) attribute

    def __init__(self, name='Hui He'):
        'constructor'
        self.name = name
        print('Created a instance for', name)

    def showname(self):
        'display your name'
        print('Your name is', self.name)


foo1 = FooClass()
foo1.showname()

foo1 = FooClass('what t fuck')
foo1.showname()

# 2.19 模块
sys.stdout.write('Hello world!\n')
print(sys.platform)
print(sys.version)

# 什么是PEP
# python Enhancement propo
# python 增强提案
# https://www.python.org/dev/peps/

# 2.20 实用的函数
print(dir(FooClass))
print(help(FooClass.showname))
print(len('Hello'))
print(int('121'))
print(str(FooClass))
print(type(foo1))
